var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var battleService = require('../../app/services/battleService');
var config = require('../config');
var dataApi = require('../../app/libs/dataApi');
var PlayerManager = require('../../app/libs/playerManager');

suite('测试battleService', function () {
    var player_manager = new PlayerManager(config.role_id);
    setup(function (done) {
        player_manager.getAllModel(function (err, model) {
            done();
        });
    });

    suite('getRecordList', function () {
        test('获取战报列表', function (done) {
            battleService.getRecordList(config.role_id, function (err, result) {
                done();
            });
        });
    });

    suite('enterBattle', function () {
        test('离开战斗', function () {
            battleService.enterBattle(player_manager);
        });
    });

    suite('exitBattle', function () {
        test('离开战斗', function () {
            battleService.exitBattle(player_manager, player_manager, 100, 1, 100);
            battleService.exitBattle(player_manager, player_manager, 100, 0, 100);
        });
    });
});
